Ordinary instant messaging software applications, such as Windows MSN or skype, or peer-to-peer software applications, verify whether two network devices are in a same network before performing a file transmission. If the two network devices are not in a same network, a server will establish a connection between each network device respectively and the file is transferred from one network device to another via the server. On the other hand, if the two network devices are in a same network, a direct connection between the two devices is established. In this way, the total travelling distance of the data is shortened, the data transmission delay is reduced, the resource of the network device is preserved, and the loading of the server is relieved.
Conventional measure for an application to locate other network devices is through asking the operating system to broadcast on the data link layer of the open systems communication (OSI) model in a local area network. The result of the broadcast can then be used to verify that the two network devices are in a same local area network. Specifically, identification codes of the network devices are retrieved corresponding to the broadcast. Then, information is retrieved from the server to verify that such identification codes do represent the network devices that direct data transmission, i.e., peer-to-peer data transmission, is to be established later.
However, the broadcasting mechanism cannot be implemented in some applications, such as the browser. One reason is that browsers only support the Hypertext Transfer Protocol (“HTTP”) and cannot use other communication protocols to ask the operating system to broadcast and capture responses on the data link layer of the OSI model so as to explore other network devices in a same local area network. In addition, application developers need to customize their applications according to the protocol that the operating system of the network device uses, instead of using the common HTTP. Complexity of application development is accordingly increased. Therefore, there is a need in the art for a browser or other applications not capable of requesting an operating system to broadcast and capture response on the data link layer of the OSI model to verify whether it is in a same local area network with other network devices.